import Vue from "vue";
import Router from "vue-router";
import Index from "./views/index"
import Home from "./views/Home/Home";
import Goods from "./views/goods/goods"
import recommend from "./views/recommend/recommend"
import search from "./views/search/search"
import chat from "./views/chat/chat"
import userCenter from "./views/user/userCenter"
import userInfo from "./views/user/chlidren/userInfo"
import setting from "./views/user/chlidren/setting"
import orders from "./views/order/orderList"
import catgoods from "./views/catgoods/catgoods"
import searchResult from "./views/searchResult/searchResult"
import confirmOrder from "./views/confirmOrder/confirmOrder"
import address from "./views/address/address"
import cart from "./views/cart/cart"
import login from "./views/auth/login"
import footprint from "./views/user/chlidren/footprint"
import hotSearch from "./views/search/children/hotSearch"
import mall from "./views/mall/mall"
import coupons from "./views/user/chlidren/coupons"
import mallCollection from "./views/user/chlidren/mallCollection"
import likes from "./views/user/chlidren/likes"
import seckill from "./views/seckill/seckill"
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      component: Index,
      children: [
        {
          path: '',
          redirect: '/home'
        },
        {
          path: "/home",
          name: "首页",
          component: Home,
        },
        {
          path: '/recommend',
          name: "推荐",
          component: recommend
        },
        {
          path: '/search',
          name: "搜索",
          component: search
        },
        {
          path: '/chat',
          name: "聊天",
          component: chat,
          meta: {
            requireLogin: true,
          },
        },
        {
          path: '/user',
          name: "个人中心",
          component: userCenter,
          meta: {
            requireLogin: true,
          },
        },

      ]
    },

    {
      path: '/goods/:id',
      component: Goods
    },
    {
      path: '/orders',
      component: orders
    },
    {
      path: '/catgoods',
      component: catgoods
    },
    {
      path: '/search_result',
      component: searchResult
    },
    {
      path: '/confirmOrder',
      component: confirmOrder
    },
    {
      path: '/address',
      component: address
    },
    {
      path: '/user/profile',
      component: userInfo,
      meta: {
        requireLogin: true,
      },
    },
    {
      path: '/user/setting',
      component: setting,
      meta: {
        requireLogin: true,
      },
    },
    {
      path: '/auth/login',
      component: login
    },
    {
      path: '/footprint',
      component: footprint
    },
    {
      path: '/coupons',
      component: coupons
    },
    {
      path: '/hotSearch',
      component: hotSearch
    },
    {
      path: '/cart',
      component: cart
    },
    {
      path: '/mall',
      component: mall
    },
    {
      path: '/mallCollection',
      component: mallCollection
    },
    {
      path: '/likes',
      component: likes
    },
    {
      path: '/seckill',
      component: seckill
    },

  ]
});
